package com.rerun.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rerun.common.util.JsonDateFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * The type Collection job.
 */
@TableName("collection_job")
public class CollectionJob extends Model<CollectionJob> {

    private static final long serialVersionUID = -1076120339327626520L;
    @TableId(type = IdType.UUID)
    private String id;
    private String memberId;
    private String jobId;
    @JsonSerialize(using = JsonDateFormat.class)
    private Date createTime;
    private int collectionStatus;
    @TableField(exist = false)
    private Set<Job> jobSet;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getCollectionStatus() {
        return collectionStatus;
    }

    public void setCollectionStatus(int collectionStatus) {
        this.collectionStatus = collectionStatus;
    }

    public Set<Job> getJobSet() {
        return jobSet;
    }

    public void setJobSet(Set<Job> jobSet) {
        this.jobSet = jobSet;
    }

    @Override
    public String toString() {
        return "{" +
                "id:" + id +
                ", memberId:" + memberId +
                ", jobId:" + jobId +
                ", createTime:" + createTime +
                ", collectionStatus:" + collectionStatus +
                ", jobSet:" + jobSet +
                '}';
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
